'use strict';
// 修改密码视图模块
import {
    titileInputInit
} from '../components/titleInput.js';


var $oldPassword,$passwordNew,$passwordNew2;
// 视图初始化
function viewInit() {
    $oldPassword = $("#old-password");
    $passwordNew = $("#password_new");
    $passwordNew2 = $("#password_new2");
    titileInputInit();
    bindViewEvent();
    $("#fanhui").on("touchstart", function() {
        history.back();
    });

}

// 验证输入框 是否允许提交
function checkedInputValue() {
    if ($oldPassword .val() != "" && $passwordNew.val() != "" && $passwordNew2.val() != "") {
        $("#submit_btn").attr("class", "weui-btn weui-btn_primary");
    } else {
        $("#submit_btn").attr("class", "weui-btn weui-btn_disabled weui-btn_default ui-link");
    }
}

// 绑定视图的事件
function bindViewEvent() {
    $(".weui-cells_form").on("input",checkedInputValue);
}
export {
    viewInit
}